<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><table id="top_location_line" width="100%"><table id="top_location_line" width="100%"><tr width="100%"><td><a href="http://www.urchin.com"><img border="0" src="../images/google_sm.gif" width="135" height="41"></a></td><td width="100%"><span id="top_line" style="width: 100%; float: left; clear: both; border-bottom: 1px solid #CCC;"><span id="top_title" style="float: left; margin-top: 10px;"><b>Help Center</b></span></td></tr></table>
<div id="page" lang="en" dir="ltr">
<div dir="ltr" id="content" lang="en">
<p class="line867"><strong>getData (SOAP) v1</strong> <ul><li><p class="line891"><a href="Data_API.html">API Table of Contents</a> </li><li><p class="line891"><a href="Report_service_(SOAP)_v1.1.html">Report Service (SOAP)</a> </li></ul><p class="line862">Method: <strong>getData</strong> <p class="line874">This method retrieves data for the specified dimensions/metrics from the following static tables: <ul><li>vistor </li><li>transaction </li><li>total </li></ul><p class="line867"><strong>SOAP Request</strong> <p class="line867"><pre>    &lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="https://urchin.com/api/urchin/v1/"&gt;
       &lt;soap:Header/&gt;
       &lt;soap:Body&gt;
          &lt;v1:getData&gt;
             &lt;!--You may enter the following 12 items in any order--&gt;
             &lt;login&gt;LOGIN&lt;/login&gt;
             &lt;password&gt;PASSWORD&lt;/password&gt;
             &lt;ids&gt;PROFILE_ID&lt;/ids&gt;
             &lt;!--Optional:--&gt;
             &lt;start-index&gt;INDEX&lt;/start-index&gt;
             &lt;!--Optional:--&gt;
             &lt;max-results&gt;MAX_RESULTS&lt;/max-results&gt;
             &lt;start-date&gt;START_DATE&lt;/start-date&gt;
             &lt;end-date&gt;END_DATE&lt;/end-date&gt;
             &lt;dimensions&gt;DIMENSIONS&lt;/dimensions&gt;
             &lt;!--Optional:--&gt;
             &lt;metrics&gt;METRICS&lt;/metrics&gt;
             &lt;!--Optional:--&gt;
             &lt;sort&gt;SORT&lt;/sort&gt;
             &lt;!--Optional:--&gt;
             &lt;filters&gt;FILTER&lt;/filters&gt;
             &lt;!--Optional:--&gt;
             &lt;table&gt;TABLE_ID&lt;/table&gt;
          &lt;/v1:getData&gt;
       &lt;/soap:Body&gt;
    &lt;/soap:Envelope&gt;
</pre><p class="line874">Request arguments: <ul><li><p class="line891"><strong>login</strong> - User name login </li><li><p class="line891"><strong>password</strong> - User password </li><li><p class="line891"><strong>ids</strong> - Comma-separated list of data source profile IDs. Currently only one ID is supported. If several IDs are specified, the first ID is used. </li><li><p class="line891"><strong>start-index</strong> (optional field) - 1-based starting index. Default value is 1. (The 1-based index is external for compatibility with Google Analytics. Internally it is 0-based). </li><li><p class="line891"><strong>max-results</strong> - Maximum number of results to return. This parameter is optional. The default value is 500. </li><li><p class="line891"><strong>start-date</strong> - First date from which to collect data in the form YYYY-MM-DD. This parameter is required. </li><li><p class="line891"><strong>end-date</strong> - Last date from which to collect data in the form YYYY-MM-DD. This parameter is required. </li><li><p class="line891"><strong>dimensions</strong> - A comma separated list of dimensions to organize the data by. This parameter is required. For a list of dimensions, see <a href="Dimensions_v1.html">Dimensions v1</a>. </li><li><p class="line891"><strong>metrics</strong> - A commas separated list of metrics to aggregate and include in the report. This parameter is optional, and may also be set to an empty string (e.g., "metrics=&amp;start-date..."). If absent or blank, the server does not return any metrics.  If user specifies same metric twice, only first one is returned (limitation of WSDL schema). For additional information, see <a href="Metrics_and_Units_v1.html">Metrics and Units v1</a>. </li><li><p class="line891"><strong>sort</strong> (optional field) - An optional parameter specifying which dimensions and metrics to sort by, in which directions and in which order. This parameter is optional, and may also be set to an empty string (e.g., sort=&amp;start-date="2008-10-10"). If absent or blank, the server sorts by first listed dimension in ascending order. In v1.0 sort supports only one column. To sort in descending order, the sort field must include the "-" sign, e.g. sort="-u:browser". </li><li><p class="line891"><strong>filters</strong> (not included in Beta) (optional field) - An optional parameter specifying to filter response data according to expression. Filter can only be applied to field, which is present in request query.  See <a href="Filters_(SOAP)_v1.html">Filters (SOAP) v1</a>. </li><li><p class="line891"><strong>table</strong> (optional field) - ID of table from which to extract data. This parameter is optional. For a list of tables, see <a href="Tables_v1.html">Tables v1</a>. </li></ul><p class="line874">Response <ul><li><p class="line891"><strong>Record[]</strong> - Response is 2-dimensional array of data, each column corresponds to dimension or metric values. Since dimensions are extensible, they can't have direct name binding. Instead they are returned as unbounded array of dimensions with names in attribute (see WSDL and example). </li></ul><p class="line867"><strong>Response WSDL</strong> <p class="line867"><pre>    &lt;xsd:complexType name="DataDimension"&gt;
        &lt;xsd:simpleContent&gt;
            &lt;xsd:extension base="xsd:string"&gt;
                &lt;xsd:attribute name="name" type="xsd:string"/&gt;
            &lt;/xsd:extension&gt;
        &lt;/xsd:simpleContent&gt;
    &lt;/xsd:complexType&gt;
    &lt;xsd:complexType name="DataDimensions"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="dimension" type="tns:DataDimension" maxOccurs="unbounded" minOccurs="1"/&gt;
        &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
    &lt;xsd:complexType name="DataMetrics"&gt;
        &lt;xsd:all&gt;
            &lt;xsd:element name="hits" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="validhits" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="errorhits" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="bytes" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="pages" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="nonpages" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="entrancepages" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="exitpages" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="bouncepages" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="pagetime" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="visits" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="visitors" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="newvisitors" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="priorvisitors" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="transactions" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="customers" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="newcustomers" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="priorcustomers" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="revenue" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:decimal"/&gt;
            &lt;xsd:element name="tax" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:decimal"/&gt;
            &lt;xsd:element name="shipping" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:decimal"/&gt;
            &lt;xsd:element name="items" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="itemrevenue" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="responses" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="impressions" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="clicks" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="cost" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:decimal"/&gt;
            &lt;xsd:element name="goals1" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goals2" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goals3" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goals4" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goalstarts1" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goalstarts2" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goalstarts3" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="goalstarts4" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:long"/&gt;
            &lt;xsd:element name="score" form="qualified" minOccurs="0" maxOccurs="1" type="xsd:decimal"/&gt;
        &lt;/xsd:all&gt;
    &lt;/xsd:complexType&gt;
    &lt;xsd:complexType name="Data"&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name="recordId" type="xsd:long" minOccurs="1" maxOccurs="1" /&gt;
            &lt;xsd:element name="dimensions" type="tns:DataDimensions" minOccurs="1" maxOccurs="1" /&gt;
            &lt;xsd:element name="metrics" type="tns:DataMetrics" minOccurs="1" maxOccurs="1" /&gt;
        &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
</pre><p class="line874">E.g.:  If the SOAP request contains the following parameters: <p class="line867"><pre>    &lt;dimensions&gt;u:browser_base,u:browser_version&lt;/dimensions&gt;
    &lt;metrics&gt;u:hits,u:bytes&lt;/metrics&gt;
</pre><p class="line874">the following response will be produced: <p class="line867"><pre>    &lt;record&gt;
     &lt;recordid&gt;1&lt;/recordid&gt;
     &lt;dimensions&gt;
      &lt;dimension name="u:browser_base"&gt;firefox&lt;/dimension&gt;
      &lt;dimension name="u:browser_version"&gt;3.0&lt;/dimension&gt;
     &lt;/dimensions&gt;
     &lt;metrics&gt;
      &lt;u:hits xmlns:u="https://urchin.com/api/urchin/v1/"&gt;20&lt;/u:hits&gt;
       &lt;u:bytes xmlns:u="https://urchin.com/api/urchin/v1/"&gt;300&lt;/u:bytes&gt;
     &lt;/metrics&gt;
    &lt;/record&gt;
    &lt;record&gt;
     &lt;recordid&gt;2&lt;/recordid&gt;
     &lt;dimensions&gt;
      &lt;dimension name="u:browser_base"&gt;chrome&lt;/u:dimension&gt;
      &lt;dimension name="u:browser_version"&gt;1.0&lt;/u:dimension&gt;
     &lt;/dimensions&gt;
     &lt;metrics&gt;
      &lt;u:hits xmlns:u="https://urchin.com/api/urchin/v1/"&gt;10&lt;/u:hits&gt;
      &lt;u:bytes xmlns:u="https://urchin.com/api/urchin/v1/"&gt;200&lt;/u:bytes&gt;
     &lt;/metrics&gt;
    &lt;/record&gt;
</pre><p class="line867"><strong>Java and .NET C# Samples</strong> <p class="line874">The following samples are available for this method: <ul><li><p class="line891"><a href="Samples_for_Java_(REST)_v1.html">Samples for Java (REST) v1</a> </li><li><p class="line891"><a href="Samples_for_.NET_(REST)_v1.html">Samples for .NET (REST) v1</a> </li></ul></div><div id="pagebottom"></div>
</div>


<div id="footer" style="clear: both; margin: 0; padding: 0; border-bottom:1px solid #CCC;"></div><div id="copyright" style="font-size: 70%; text-align: center;">&copy;2010 Google</div>
</body></html>